package cn.ml.gaoJi.api.jieQuZiFuChuan;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class TestSubString {
    public static void main(String[] args) {

        String str = "123456";
        String s = str.substring(str.length() - 2);
        System.out.println(s);

        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        Calendar c = Calendar.getInstance();
        Date date = new Date();
        System.out.println("date格式："+date);
        String dateFormat = sdf.format(date.getTime());
        System.out.println("dateFormat格式："+dateFormat);
        long timeLong = System.currentTimeMillis();
        System.out.println("currentTimeMillis格式："+timeLong);
        System.out.println("currentTimeMillis转换后格式："+sdf.format(timeLong));

    }
}
